<cfcomponent extends="assets.csac.com.Base">

	<cffunction name="call" access="public" output="false" returntype="any">
		<cfargument name="objType" type="string" required="true" />
		<cfargument name="obj" type="string" required="true" />
		<cfset var result = "">
		<cfif arguments.objType eq "storedProcedure">
			<cfstoredproc datasource="#getDatasource()#" procedure="#arguments.obj#">
				<cfswitch expression="#arguments.obj#">
					<cfcase value="authUser">
						<cfprocparam value="#arguments.User_ID#" cfsqltype="cf_sql_integer" null="#IIf(Len(Trim(arguments.User_ID)) gt 0, false, true)#" /> 
						<cfprocparam value="#arguments.Email#" cfsqltype="cf_sql_varchar" null="#IIf(Len(Trim(arguments.Email)) gt 0, false, true)#" /> 
						<cfprocparam value="#arguments.Password#" cfsqltype="cf_sql_varchar" null="#IIf(Len(Trim(arguments.Password)) gt 0, false, true)#" /> 
					</cfcase>
					<cfcase value="findHighSchools">
						<cfprocparam value="#arguments.term#" cfsqltype="cf_sql_varchar" null="false" /> 
					</cfcase>
					<cfcase value="findInstitutions">
						<cfprocparam value="#arguments.term#" cfsqltype="cf_sql_varchar" null="false" /> 
					</cfcase>
					<cfcase value="readHighSchool">
						<cfprocparam value="#arguments.High_School_ID#" cfsqltype="cf_sql_integer" null="false" /> 
					</cfcase>
					<cfcase value="readInstitution">
						<cfprocparam value="#arguments.Institution_ID#" cfsqltype="cf_sql_integer" null="false" /> 
					</cfcase>
				</cfswitch>
				<cfprocresult name="result" />
			</cfstoredproc>
		<cfelseif arguments.objType eq "view">
			<cfquery name="result" datasource="#getDatasource()#">
				select *
				from #arguments.obj#
				<cfif arguments.obj eq "getHighSchools">
					order by High_School
				<cfelseif arguments.obj eq "getInstitutions">
					order by Institution
				<cfelseif arguments.obj eq "getCities">
					order by City
				<cfelseif arguments.obj eq "getCounties">
					order by County
				</cfif>
			</cfquery>
		</cfif>
		<cfreturn result />
	</cffunction>
	
</cfcomponent>